PROJECTENGRAM

SIGNED MULTIPLICATION (BOOTH'S & EXTENDED BOOTH'S ALGORITHM)

Module 05: Signed Multiplication (Booth's & Extended Booth's Algorithm)

Tags: #◇Computer Science #◇CSARCH2 #◇Computer Architecture #◇Hardware Modeling #◇Signed Multiplication (Booth's & Extended Booth's Algorithm)


◇Overview

Multiplying signed integers in 2's complement representation poses distinct architectural challenges because the Most Significant Bit (MSB) carries a negative positional weight (−2n−1-2^{n-1}). Simple shift-and-add algorithms fail for negative operands without cumbersome sign-extension corrections. This module analyzes the mathematical foundations of signed multiplication, beginning with paper-and-pencil 2's complement multiplication. We then formalize Booth's Algorithm (Radix-2), which treats contiguous blocks of 1s as single algebraic operations, and Extended Booth's Algorithm (Radix-4 Bit-Pair Recoding), which halves the required adder cycles and partial products by inspecting three multiplier bits simultaneously.

◇Key Definitions

  • Radix-2 Booth's Recoding: A technique that encodes an nn-bit multiplier into signed digits {−1,0,+1}\{-1, 0, +1\} by inspecting adjacent bit pairs (Qi,Qi−1)(Q_i, Q_{i-1}), transforming consecutive sequences of additions into a single addition and a single subtraction.
  • Extended Booth's Algorithm (Radix-4 Bit-Pair Recoding): An optimized multiplication algorithm that evaluates triplets of overlapping multiplier bits (Q2i+1,Q2i,Q2i−1)(Q_{2i+1}, Q_{2i}, Q_{2i-1}) to generate multiplier factors in the set {−2,−1,0,+1,+2}\{-2, -1, 0, +1, +2\}, reducing total partial products to ⌈n/2⌉\lceil n/2 \rceil.
  • Q−1Q_{-1} Flip-Flop: An implicit 1-bit register appended to the right of the multiplier register QQ, initialized to 0, used to store the bit shifted out of the multiplier during Arithmetic Shift Right.
  • Arithmetic Shift Right (ASRASR): A shift operation that moves all bits of the composite register [A,Q,Q−1][A, Q, Q_{-1}] one position to the right while replicating the sign bit (An−1A_{n-1}) in An−1A_{n-1}, preserving the mathematical sign of negative 2's complement numbers.
  • String Property of 1s: The mathematical identity showing that a contiguous run of 1s from position mm to kk (k>mk > m) can be evaluated as:
    2k+2k−1+⋯+2m=2k+1−2m2^k + 2^{k-1} + \dots + 2^m = 2^{k+1} - 2^m

◇Theoretical Framework / Core Concepts

1. The Challenge of Signed 2's Complement Multiplication

Let MM and QQ be nn-bit 2's complement numbers. The multiplier QQ is formally expressed as:
Q=−Qn−12n−1+∑i=0n−2Qi2iQ = -Q_{n-1} 2^{n-1} + \sum_{i=0}^{n-2} Q_i 2^i

If QQ is negative (Qn−1=1Q_{n-1} = 1), its MSB must be subtracted rather than added:
P=M×Q=M×(−Qn−12n−1+∑i=0n−2Qi2i)=−M⋅Qn−12n−1+∑i=0n−2M⋅Qi2iP = M \times Q = M \times \left( -Q_{n-1} 2^{n-1} + \sum_{i=0}^{n-2} Q_i 2^i \right) = -M \cdot Q_{n-1} 2^{n-1} + \sum_{i=0}^{n-2} M \cdot Q_i 2^i

Paper-and-Pencil Rules for Signed Multiplication:

  1. Every intermediate partial product must be sign-extended to the full 2n2n-bit result width.
  2. If the multiplier is negative, the final partial product corresponding to the MSB (Qn−1Q_{n-1}) must be subtracted (by adding the 2's complement of MM, −M-M).
『』
TEXT
Paper-and-Pencil Example: (-5) x (+3) in 4-bit (Product = -15, 8-bit):
   M = 1011 (-5)
   Q = 0011 (+3)
   -------------------------------------------------
   1 1 1 1 1 0 1 1   (Partial Product 0: M * 1, sign extended to 8 bits)
   1 1 1 1 0 1 1 0   (Partial Product 1: M * 1 << 1, sign extended)
   0 0 0 0 0 0 0 0   (Partial Product 2: M * 0 << 2)
   0 0 0 0 0 0 0 0   (Partial Product 3: M * 0 << 3)
   -------------------------------------------------
   1 1 1 1 0 0 0 1   (8-bit 2's complement = -15 in decimal)  (Correct!)

2. Booth's Algorithm (Radix-2)

Booth's algorithm takes advantage of the fact that a sequence of ones:
0111102⏟decimal 30=24+23+22+21=16+8+4+2=30\underbrace{011110_2}_{\text{decimal } 30} = 2^4 + 2^3 + 2^2 + 2^1 = 16 + 8 + 4 + 2 = 30
can be replaced by two operations:
25−21=32−2=302^5 - 2^1 = 32 - 2 = 30

Hardware Datapath Setup:

  • Accumulator (AA): nn bits, initialized to 00...0.
  • Multiplier (QQ): nn bits, holds QQ.
  • Implicit Bit (Q−1Q_{-1}): 1 bit, initialized to 0.
  • Multiplicand (MM): nn bits, holds MM.
  • ALU: Capable of A+MA + M and A−MA - M (A+M‾+1A + \overline{M} + 1).
  • Counter: Initialized to nn.
『』
TEXT
+-------------------------------------------------------------------------+
|                        BOOTH'S MULTIPLIER DATAPATH                      |
|                                                                         |
|      +-----------------------------------+                              |
|      |    Multiplicand Register (M)      |                              |
|      +-----------------------------------+                              |
|                         |                                               |
|                         v                                               |
|             +-----------------------+                                   |
|             |  ALU Adder/Subtractor |                                   |
|             +-----------------------+                                   |
|                         ^                                               |
|                         |                                               |
|                         v                                               |
|      +-----------------------+      +-----------------------+      +--+ |
|      |Accumulator Register(A)| ---> |Multiplier Register(Q) | ---> |Q | |
|      | (n bits, init 0)      |      | (n bits, holds Q)     |      |-1| |
|      +-----------------------+      +-----------------------+      +--+ |
|          |       |                             |       |            |   |
|          +-------+--- Arithmetic Shift Right --+-------+------------+   |
|               (ASR: sign bit A_{n-1} replicated)       |            |   |
|                                                        v            v   |
|      Control Logic <------------------------------ [  Q0   ,   Q-1  ]   |
+-------------------------------------------------------------------------+

Radix-2 Decision Table:

Q0Q_0Q−1Q_{-1}Algebraic InterpretationDatapath Action
00String of zeros / no transitionDo nothing; ASR [A,Q,Q−1][A, Q, Q_{-1}]
01End of a run of ones (…01…\dots 01\dots)A←A+MA \leftarrow A + M; then ASR [A,Q,Q−1][A, Q, Q_{-1}]
10Beginning of a run of ones (…10…\dots 10\dots)A←A−MA \leftarrow A - M; then ASR [A,Q,Q−1][A, Q, Q_{-1}]
11Middle of a run of onesDo nothing; ASR [A,Q,Q−1][A, Q, Q_{-1}]

3. Extended Booth's Algorithm (Radix-4 Bit-Pair Recoding)

Standard Booth's algorithm requires nn clock cycles for an nn-bit operand. Extended Booth's Algorithm groups multiplier bits in sets of three overlapping bits: (Q2i+1,Q2i,Q2i−1)(Q_{2i+1}, Q_{2i}, Q_{2i-1}) for i=0,1,…,n2−1i = 0, 1, \dots, \frac{n}{2}-1.

『』
TEXT
Radix-4 Bit Grouping (8-bit Multiplier Example):
  Q7   Q6   Q5   Q4   Q3   Q2   Q1   Q0  | Q_{-1}
 [   Triplet 3   ]                     |
      [   Triplet 2   ]                |
           [   Triplet 1   ]           |
                [   Triplet 0   ]      | (init Q_{-1}=0)

Bit-Pair Recoding Formulation:

Multiplier Recoded Value Xi=−2⋅Q2i+1+Q2i+Q2i−1\text{Multiplier Recoded Value } X_i = -2 \cdot Q_{2i+1} + Q_{2i} + Q_{2i-1}

Radix-4 Recoding Table:

Q2i+1Q_{2i+1}Q2iQ_{2i}Q2i−1Q_{2i-1}Recoded Multiplier FactorHardware Operation
00000Add 00
001+1+1Add 1×M1 \times M
010+1+1Add 1×M1 \times M
011+2+2Add 2×M2 \times M (Shift MM left 1 bit)
100−2-2Subtract 2×M2 \times M (Add 2's complement of 2M2M)
101−1-1Subtract 1×M1 \times M (Add 2's complement of MM)
110−1-1Subtract 1×M1 \times M (Add 2's complement of MM)
11100Add 00

Advantages of Radix-4:

  • Halves the number of adder iterations to n/2n/2.
  • +2M+2M and −2M-2M are generated by a simple 1-bit hardwired left shift of MM or −M-M, requiring no complex multiplication hardware.

◇Worked Examples / Calculations / Hardware Traces

Example 1: Booth's Algorithm (Radix-2) Execution Trace ((−6)×(+3)(-6) \times (+3))

Problem: Multiply signed 4-bit numbers M=10102 (−610)M = 1010_2\ (-6_{10}) and Q=00112 (+310)Q = 0011_2\ (+3_{10}) using Radix-2 Booth's algorithm. Show the complete step-by-step register trace. Expected product: −1810=111011102-18_{10} = 11101110_2 (8-bit 2's complement).

Setup:

  • Multiplicand M=10102 (−6)M = 1010_2\ (-6)
  • Two's complement of MM: −M=01102 (+6)-M = 0110_2\ (+6)
  • Initial state: A=00002A = 0000_2, Q=00112Q = 0011_2, Q−1=0Q_{-1} = 0, Count=4\text{Count} = 4.

Execution Trace Table:

StepCondition (Q0,Q−1Q_0, Q_{-1})OperationAAQQQ−1Q_{-1}Count
Init—Clear A,Q−1A, Q_{-1}; Load M,QM, Q0000001104
1Q0Q−1=10Q_0 Q_{-1} = 10A←A−M (A+(−M))A \leftarrow A - M\ (A + (-M))0110001104
ASR [A,Q,Q−1][A, Q, Q_{-1}]0011000113
2Q0Q−1=11Q_0 Q_{-1} = 11No arithmetic operation0011000113
ASR [A,Q,Q−1][A, Q, Q_{-1}]0001100012
3Q0Q−1=01Q_0 Q_{-1} = 01A←A+MA \leftarrow A + M (0001+1010=10110001 + 1010 = 1011)1011100012
ASR [A,Q,Q−1][A, Q, Q_{-1}]1101110001
4Q0Q−1=00Q_0 Q_{-1} = 00No arithmetic operation1101110001
ASR [A,Q,Q−1][A, Q, Q_{-1}]1110111000
  • Final 8-bit Result: [A,Q]=111011102[A, Q] = 11101110_2.
  • Decimal Verification:
    111011102=−128+64+32+8+4+2=−1810✓11101110_2 = -128 + 64 + 32 + 8 + 4 + 2 = -18_{10} \quad \checkmark

Example 2: Extended Booth's (Radix-4) Bit-Pair Recoding Calculation

Problem: Multiply 6-bit signed integers M=0101012 (+2110)M = 010101_2\ (+21_{10}) and Q=1101102 (−1010)Q = 110110_2\ (-10_{10}) using Radix-4 Bit-Pair Recoding. Expected product: −21010-210_{10}.

Solution:

  1. Recode Multiplier Q=1101102Q = 110110_2 with appended Q−1=0Q_{-1} = 0:
    Bits: Q5Q4Q3⏟Triplet 2 Q3Q2Q1⏟Triplet 1 Q1Q0Q−1⏟Triplet 0  ⟹  Overlapping pairs: (Q1Q0Q−1),(Q3Q2Q1),(Q5Q4Q3)\text{Bits: } \underbrace{Q_5 Q_4 Q_3}_{\text{Triplet 2}}\ \underbrace{Q_3 Q_2 Q_1}_{\text{Triplet 1}}\ \underbrace{Q_1 Q_0 Q_{-1}}_{\text{Triplet 0}} \implies \text{Overlapping pairs: } (Q_1 Q_0 Q_{-1}), (Q_3 Q_2 Q_1), (Q_5 Q_4 Q_3)

    • Triplet 0 (Q1Q0Q−1Q_1 Q_0 Q_{-1}): Bits 1,0,0  ⟹  Recoded Factor=−21, 0, 0 \implies \text{Recoded Factor} = -2
    • Triplet 1 (Q3Q2Q1Q_3 Q_2 Q_1): Bits 0,1,1  ⟹  Recoded Factor=+20, 1, 1 \implies \text{Recoded Factor} = +2
    • Triplet 2 (Q5Q4Q3Q_5 Q_4 Q_3): Bits 1,1,0  ⟹  Recoded Factor=−11, 1, 0 \implies \text{Recoded Factor} = -1
  2. Compute Multiples of M=0101012 (+21)M = 010101_2\ (+21):

    • +1M=000000 0101012 (+21)+1M = 000000\ 010101_2\ (+21)
    • +2M=000000 1010102 (+42)+2M = 000000\ 101010_2\ (+42)
    • −1M=111111 1010112 (−21)-1M = 111111\ 101011_2\ (-21)
    • −2M=111111 0101102 (−42)-2M = 111111\ 010110_2\ (-42)
  3. Sum Partial Products (Shifted by 2 bits per stage):

    『』
    TEXT
    Stage 0 (-2M * 4^0):   1 1 1 1 1 1 0 1 0 1 1 0
    Stage 1 (+2M * 4^1):   1 1 1 0 1 0 1 0 - - - -  (000000101010 << 2)
    Stage 2 (-1M * 4^2):   1 0 1 0 1 1 - - - - - -  (111111101011 << 4)
    --------------------------------------------------------------------
    Sum (12-bit Result):   1 1 1 1 0 0 1 0 1 1 1 0_2
    
  4. Verify Decimal Value of 1111001011102111100101110_2:

    • Invert: 0000110100012000011010001_2
    • Add 1: 0000110100102=128+64+16+2=21010000011010010_2 = 128 + 64 + 16 + 2 = 210_{10}
    • Value: −21010✓-210_{10} \quad \checkmark

◇Complexity Analysis / Common Pitfalls

  • Logical Shift Right vs. Arithmetic Shift Right: The single most common failure in implementing Booth's algorithm is performing a Logical Shift Right (LSRLSR) instead of an Arithmetic Shift Right (ASRASR). In ASRASR, bit An−1A_{n-1} must be copied to itself so that negative numbers retain their leading ones.
  • Off-by-One Bit Triplet Grouping in Radix-4: In Extended Booth's recoding, students often create non-overlapping triplets (Q2Q1Q0)(Q_2 Q_1 Q_0) instead of overlapping triplets (Q2i+1,Q2i,Q2i−1)(Q_{2i+1}, Q_{2i}, Q_{2i-1}). Triplet 0 must always include Q−1=0Q_{-1} = 0 as its rightmost bit.
  • Sign Extension of Multiplicand in ALU: During A←A−MA \leftarrow A - M or A←A+MA \leftarrow A + M, arithmetic must be carried out across the full nn-bit register width without dropping the MSB carry/overflow until ASRASR occurs.

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

In Radix-2 Booth's algorithm, what hardware action is taken when the bit pair Q0Q−1=10Q_0 Q_{-1} = 10?

Q2

What is the primary performance advantage of Extended Booth's (Radix-4) multiplication over standard Booth's (Radix-2) multiplication?

Q3

In Radix-4 Extended Booth's recoding, what operation corresponds to the multiplier bit triplet 011?

Q4

What is the initial value of the Q−1Q_{-1} flip-flop at the start of Booth's algorithm?

Q5

Why does Booth's algorithm perform Arithmetic Shift Right (ASRASR) rather than Logical Shift Right (LSRLSR)?

Signed Multiplication (Booth's & Extended Booth's Algorithm) | PROJECT ENGRAM